/*********************************************************
          File Name:static_member.cpp
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Sat 12 Dec 2015 08:24:40 PM CST
**********************************************************/

// NOTE
// this is a bad example which trys to instantiate a static member with different `Type`

#include <iostream>

template<typename Type>
class Test
{
        private:
                static Type m;
        public:
                Test() = default;
                ~Test() = default;

                void print()
                {
                        std::cout << m << std::endl;
                }

                void plus()
                {
                        ++m;
                }

                void sub()
                {
                        --m;
                }
};

int main(void)
{
        Test<int> a;
        Test<float> b;

        a.print();
        b.print();

        a.plus();
        a.print();

        b.plus();
        b.print();

        a.sub();
        b.print();

        return 0;
}
